package com.wang.helloandroid.util;

import java.io.UnsupportedEncodingException;

import android.util.Base64;
import android.util.Log;

public class Encrypt {
	final static String tag = Encrypt.class.getName();
	
	public static String base64Encode(String str)
	{
		try
		{
			return Base64.encodeToString(str.getBytes("UTF-8"), Base64.DEFAULT).trim();
		}
		catch(UnsupportedEncodingException e)
		{
			Log.e(tag, e.getMessage());
		}
		
		return null;
	}
}
